home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCMania 39
/
PCMania CD39_2.iso
/
pcmania
/
mod39
/
modinfo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-22
|
24KB
|
366 lines
// *** ------------------------------------- ***
// * Mod - Info , programado por *
// * Esteban Moreno Valdés *
// * ( Colaborador de la revista Pcmanía ) *
// *** ------------------------------------- ***
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <process.h>
#include <string.h>
#include <fcntl.h>
#define BYTE unsigned char
#define WORD unsigned int
// Informaciones generales del fichero MOD
BYTE file_name[16];
BYTE song_name[21]; // Título de la canción
BYTE patrones; // Número de patrones
BYTE constant; // Constante
BYTE tabla[129]; // Patterns
BYTE id[5]; // M.K.
// Informaciones de cada instrumento
struct {
BYTE name[23]; // Nombre del sample
WORD length; // Tamaño del sample
BYTE fine; // Finetune
BYTE vol; // Volumen del sample
WORD orep; // Offset de repetición
WORD lrep; // Longitud de repetición
} SAMPLE[31];
// A continuación aparecerá la información codificada de la pantalla
// en modo texto. Si no lo entendéis tranquilos puesto que esto
// no entra dentro de nuestro temario.
BYTE screen [] = {
32, 94, 32, 94, 77, 94, 111, 94, 100, 94, 45, 94, 73, 94, 110, 94, 102, 94, 111, 94, 32, 94, 32, 94, 124, 94, 32, 94,
32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 80, 94, 114, 94, 111, 94, 103, 94, 114, 94, 97, 94, 109, 94,
97, 94, 100, 94, 111, 94, 32, 94, 112, 94, 111, 94, 114, 94, 32, 94, 69, 94, 115, 94, 116, 94, 101, 94, 98, 94, 97, 94,
110, 94, 32, 94, 77, 94, 111, 94, 114, 94, 101, 94, 110, 94, 111, 94, 32, 94, 86, 94, 97, 94, 108, 94, 100, 94, 130, 94,
115, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 32, 94, 124, 94, 32, 94, 32, 94,
77, 94, 111, 94, 100, 94, 45, 94, 73, 94, 110, 94, 102, 94, 111, 94, 32, 94, 32, 94, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 78, 73, 78, 110, 78, 102, 78, 111, 78, 114, 78, 109, 78, 97, 78,
99, 78, 105, 78, 111, 78, 110, 78, 101, 78, 115, 78, 32, 78, 103, 78, 101, 78, 110, 78, 101, 78, 114, 78, 97, 78, 108, 78,
101, 78, 115, 78, 32, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 84, 78, 97, 78, 98, 78, 108, 78, 97, 78, 32, 78, 100, 78, 101, 78, 32, 78, 112, 78,
97, 78, 116, 78, 116, 78, 101, 78, 114, 78, 110, 78, 115, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 32, 30, 32, 30, 78, 30, 111, 30, 109, 30, 98, 30, 114, 30, 101, 30, 32, 30, 100, 30, 101, 30, 108, 30, 32, 30,
102, 30, 105, 30, 99, 30, 104, 30, 101, 30, 114, 30, 111, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 84, 30,
161, 30, 116, 30, 117, 30, 108, 30, 111, 30, 32, 30, 100, 30, 101, 30, 32, 30, 108, 30, 97, 30, 32, 30, 99, 30, 97, 30,
110, 30, 99, 30, 105, 30, 162, 30, 110, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 78, 30, 163, 30, 109, 30, 101, 30, 114, 30,
111, 30, 32, 30, 100, 30, 101, 30, 32, 30, 112, 30, 97, 30, 116, 30, 116, 30, 101, 30, 114, 30, 110, 30, 115, 30, 32, 30,
32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16,
176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 86, 30, 97, 30, 108, 30, 111, 30, 114, 30, 32, 30, 99, 30, 111, 30, 110, 30,
115, 30, 116, 30, 97, 30, 110, 30, 116, 30, 101, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30,
32, 30, 73, 30, 110, 30, 100, 30, 101, 30, 110, 30, 116, 30, 105, 30, 102, 30, 105, 30, 99, 30, 97, 30, 99, 30, 105, 30,
162, 30, 110, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 78, 73, 78, 110, 78, 102, 78, 111, 78, 114, 78,
109, 78, 97, 78, 99, 78, 105, 78, 111, 78, 110, 78, 101, 78, 115, 78, 32, 78, 100, 78, 101, 78, 32, 78, 99, 78, 97, 78,
100, 78, 97, 78, 32, 78, 105, 78, 110, 78, 115, 78, 116, 78, 114, 78, 117, 78, 109, 78, 101, 78, 110, 78, 116, 78, 111, 78,
32, 78, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 83, 30, 97, 30, 109, 30, 112, 30, 108, 30,
101, 30, 32, 30, 110, 30, 163, 30, 109, 30, 101, 30, 114, 30, 111, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 176, 16,
176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 78, 30, 111, 30, 109, 30, 98, 30, 114, 30, 101, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30,
32, 30, 76, 30, 111, 30, 110, 30, 103, 30, 105, 30, 116, 30, 117, 30, 100, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 70, 30, 105, 30, 110, 30,
101, 30, 116, 30, 117, 30, 110, 30, 101, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 86, 30, 111, 30, 108, 30, 117, 30, 109, 30, 101, 30, 110, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16,
176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16,
176, 16, 32, 30, 32, 30, 76, 30, 111, 30, 111, 30, 112, 30, 32, 30, 115, 30, 116, 30, 97, 30, 114, 30, 116, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 76, 30,
111, 30, 111, 30, 112, 30, 32, 30, 101, 30, 110, 30, 100, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 58, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
176, 16, 176, 16, 176, 16, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30,
32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 32, 30, 178, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 85, 30,
115, 30, 97, 30, 32, 30, 108, 30, 97, 30, 32, 30, 116, 30, 101, 30, 99, 30, 108, 30, 97, 30, 115, 30, 32, 30, 60, 30,
45, 30, 32, 30, 121, 30, 32, 30, 45, 30, 62, 30, 32, 30, 112, 30, 97, 30, 114, 30, 97, 30, 32, 30, 99, 30, 97, 30,
109, 30, 98, 30, 105, 30, 97, 30, 114, 30, 32, 30, 100, 30, 101, 30, 32, 30, 105, 30, 110, 30, 115, 30, 116, 30, 114, 30,
117, 30, 109, 30, 101, 30, 110, 30, 116, 30, 111, 30, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16, 178, 16,
178, 16, 178, 16, 178, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16,
176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16, 176, 16
};
void set_video_mode(BYTE); // Establece nuevo modo de pantalla
void get_info(BYTE fichero[16]); // Lee información del fichero
void display_screen(); // Visualiza el entorno
void display_inform(); // Imprime las informaciones generales
void no_cursor(); // Elimina el molesto cursor de la pantalla
void fin(); // Muestra el mensaje final
WORD xchange(WORD); // Pasa al formato BACKWORDS
void main(int argc, BYTE *argv[])
{
no_cursor();
textattr(30);
if (argc<2) { printf("Error : Falta parámetro requerido.\n");
printf("Sintaxis : Modinfo fichero.MOD.\n\n");
exit(0);
}
set_video_mode(3); // Modo alfanumérico
get_info(argv[1]);
no_cursor();
display_screen();
display_inform();
fin();
}
void set_video_mode(BYTE mode)
{
asm {
xor ah,ah
mov al,mode
int 10h
}
}
void get_info(BYTE fichero[])
{
int handle;
BYTE i;
unsigned bytes_read;
strcpy(file_name,fichero); // Copia una cadena
if ((_dos_open(fichero,O_RDONLY,&handle))!=0) {
printf("\nError : No se puede abrir el fichero especificado.\n\n");
exit(0);
}
_dos_read(handle,song_name,20,&bytes_read);
for (i=0;i<=30;i++) {
_dos_read(handle,SAMPLE[i].name,22,&bytes_read);
_dos_read(handle,&SAMPLE[i].length,2,&bytes_read);
_dos_read(handle,&SAMPLE[i].fine,1,&bytes_read);
_dos_read(handle,&SAMPLE[i].vol,1,&bytes_read);
_dos_read(handle,&SAMPLE[i].orep,2,&bytes_read);
_dos_read(handle,&SAMPLE[i].lrep,2,&bytes_read);
// Fijaos bien en la modificaciones que llevo a cabo
// en las siguientes variables
SAMPLE[i].length=xchange(SAMPLE[i].length);
SAMPLE[i].orep=xchange(SAMPLE[i].orep);
SAMPLE[i].lrep=xchange(SAMPLE[i].lrep);
if (SAMPLE[i].lrep==1) { SAMPLE[i].lrep=0; }
}
// De momento no multiplico por dos, sino que los haré
// a la hora de imprimir dichas variables, para que
// se entienda mejor.
_dos_read(handle,&patrones,1,&bytes_read);
_dos_read(handle,&constant,1,&bytes_read);
_dos_read(handle,tabla,128,&bytes_read);
_dos_read(handle,id,4,&bytes_read);
_dos_close(handle);
if (!strcmp(id,"M.K")) { printf("Error : El fichero cargado no es un standard\n");
printf(" de cuatro canales.\n\n");
exit(0);
}
}
WORD xchange(WORD wrd)
{
asm {
mov ax,wrd
xchg ah,al
mov wrd,ax
}
return(wrd);
}
void display_screen()
{
asm {
mov ax,0b800h
mov es,ax
xor di,di
push ds
mov ax,seg screen
mov ds,ax
mov si,offset screen
mov cx,2000
}
bucle:;
asm {
mov ax,ds:[si] // Aquí toda la información conte-
mov es:[di],ax // nida en el enorme array del prin-
add si,2 // cipio es pasada a la pantalla
add di,2 // en forma de carácteres
loop bucle
pop ds
}
}
void no_cursor()
{
asm {
mov ah,1 // Establece el nuevo tamaño del cursor
mov cl,0
mov ch,1
int 10h
}
}
void display_inform()
{
BYTE i=0,x,y=6,temp=patrones-1,c=0;
char r=0;
textattr(94);
for (y=6;y<=21;y++) {
x=56;
for (;x<=77;x+=3,i++) {
gotoxy(x,y);
cprintf("%02X",tabla[i]);
if (temp--<=0) textattr(30);
}
}
gotoxy(29,5); printf("%22s",file_name);
gotoxy(29,6); printf("%22s",song_name);
gotoxy(35,7); printf("%02Xh · %02ud",patrones,patrones);
gotoxy(35,8); printf("%02Xh · %03ud",constant,constant);
gotoxy(29,9); printf("%22s",id);
textattr(78);
gotoxy(63,24); cprintf("·PCMANIA·");
while (r!=27) {
gotoxy(48,14); printf("%2dd",c+1);
gotoxy(29,15); printf("%22s",SAMPLE[c].name);
gotoxy(35,16); printf("%04Xh · %05ud",SAMPLE[c].length*2,SAMPLE[c].length*2);
gotoxy(35,17); printf("%02Xh · %02ud",SAMPLE[c].fine,SAMPLE[c].fine);
gotoxy(35,18); printf("%02Xh · %02ud",SAMPLE[c].vol,SAMPLE[c].vol);
gotoxy(35,19); printf("%04Xh · %05ud",SAMPLE[c].orep*2,SAMPLE[c].orep*2);
gotoxy(35,20); printf("%04Xh · %05ud",SAMPLE[c].lrep*2+SAMPLE[c].orep*2,
SAMPLE[c].lrep*2+SAMPLE[c].orep*2);
r=getch();
if (r=='4') { if(c--<=0) c=30; }
else if (r=='6') { if(c++>=30) c=0; }
}
}
void fin()
{
set_video_mode(3);
printf("╔════════════════════════════════════════╗\n");
printf("║ · Mod-Info · ║\n");
printf("║ Programado por Esteban Moreno Valdés ║\n");
printf("║ para la revista Pcmanía ║\n");
printf("╚════════════════════════════════════════╝\n\n");
}